package com.cn.wxwinnie.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.http.HttpRequest;

/**
 * @author 潇湘暮雨 E-mail:wxwinnie@hotmail.com
 *
 * @version 创建时间：2014年3月23日 下午1:50:03
 *
 */
public class SafeTyFilter implements Filter {

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
		// TODO Auto-generated method stub

	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
//		System.out.println(request.getLocalAddr());
//		System.out.println(request.getLocalName());
//		System.out.println(request.getRemoteAddr());
//		System.out.println(((HttpServletRequest)request).getLocalAddr());
//		System.out.println(((HttpServletRequest)request).getLocalAddr());
//		System.out.println(((HttpServletRequest)request).getLocalName());
//		System.out.println(((HttpServletRequest)request).getRequestURL());
//		System.out.println(((HttpServletRequest)request).getMethod());
		chain.doFilter(request, response);//放行。让其走到下个链或目标资源中 
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub

	}

}
